package de.jmda.gen.java.impl;

import static org.junit.Assert.assertTrue;

import org.apache.log4j.Logger;
import org.junit.Test;

import de.jmda.gen.GeneratorException;

public class JUTDefaultJavaDocGenerator
{
	private final static Logger LOGGER =
      Logger.getLogger(JUTDefaultJavaDocGenerator.class);

	@Test
	public void testDefaultJavaDocGenerator() throws GeneratorException
	{
		DefaultJavaDocGenerator generator = new DefaultJavaDocGenerator();

		StringBuffer generated = generator.generate();

		LOGGER.debug("generated [" + generated + "]");

		assertTrue(
				"unexpected java doc [" + generated + "]",
				("/**" + System.lineSeparator() + " */").contentEquals(generated));
	}

	@Test
	public void testDefaultJavaDocGeneratorStrings() throws GeneratorException
	{
		String input1 = "test1";
		String input2 = "test2";

		DefaultJavaDocGenerator generator =
				new DefaultJavaDocGenerator(input1, input2);

		StringBuffer generated = generator.generate();

		LOGGER.debug("generated [" + generated + "]");

		assertTrue(
				"unexpected java doc [" + generated + "]",
				(
						"/**"          + System.lineSeparator() +
						" * " + input1 + System.lineSeparator() +
						" * " + input2 + System.lineSeparator() +
						" */"
				).contentEquals(generated));
	}
}